import flock_linux
import os

import time

if __name__ == "__main__":
    pid = os.getpid()
    flock = flock_linux.flock("./flock")
    
    for index in range(30):
        # 临界区
        flock.lock()
        print("pid :", pid, "get the flock")
        time.sleep(1)
        flock.unlock()
        time.sleep(1)
        
        
    
   
